package server

import (
	"crypto/rand"
	"encoding/hex"
	"sync/atomic"
)

var _id int32 = 1

func GetId() int32 {
	v := atomic.AddInt32(&_id, 1)

	return v
}

var _ssrc uint32 = 1

func getSSRC() uint32 {
	v := atomic.AddUint32(&_ssrc, 1)

	return v
}

func GetUID() string {
	buffer := make([]byte, 10)
	_, _ = rand.Read(buffer)

	return hex.EncodeToString(buffer)
}
